package com.jinchange.mysqlandredis.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jinchange.mysqlandredis.entity.Person;


/**
 * @ClassName: PersonService
 * @Author zhangjin
 * @Date 2021/8/4 18:47
 * @Description: MybatisPlus查询案例
 */
public interface PersonService {

    Person addPerson(Person person);

    Person findPerson(Long id);

    Person setPerson(Person person);

    boolean deletePerson(Long id);

    /**
     * 分页查询
     */
    IPage<Person> findPersonByPagination(Integer current, Integer size);

    /**
     * 自定义SQL; name 和 age 条件查询
     */
    IPage<Person> findPersonByNameOrAge(Page<Person> page, String name, Integer age);

}
